<script lang="jsx">
import { ref } from 'vue'
// vue3格式写法
export default{
  setup() {
    let count = ref(0)
    let onclick = ()=>{
      count.value++
    }
    return () => (
      <>
      <h2>compon</h2>
      <p onClick={onclick}>{count.value}</p>
      </>
    )
  }
}


/**
 * 原始写法
 export default {
  data() {
    return {
      count:0
    }
  },
  methods: {
    onclick(){
      this.count++
    }
  },
  render(h) {
    return (
      <>
      <h2>compon</h2>
      <p onClick={this.onclick}>{this.count}</p>
      </>
    )
  }
};
 */

</script>
